<template>
	<view class="row">
		<view class="span24-8 px-2 mb-2" v-for="(item, i) in radioList.list" :key="i">
			<view
				class="rounded px-2 py-1 text-center bg-light-secondary text-muted border border-light-secondary"
				@tap="radioTap(i)"
				:class="i === radioList.currentIndex ? 'radio_active' : ''"
			>
				{{ item.name }}
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		radioList: {
			type: Object,
			default: () => {}
		}
	},
	methods: {
		radioTap(i) {
			this.$emit('update:currentIndex', i);
		}
	}
};
</script>
<style scoped lang="scss">
.radio_active {
	color: #eb7320 !important;
	background-color: #fce0d5 !important;
	border-color: #eb7320 !important;
}
</style>
